/**
 * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */

package doan.quanlycanbo.portlet.service.persistence;

import com.liferay.portal.kernel.bean.PortletBeanLocatorUtil;
import com.liferay.portal.kernel.dao.orm.DynamicQuery;
import com.liferay.portal.kernel.exception.SystemException;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.service.ServiceContext;

import doan.quanlycanbo.portlet.model.donvi;

import java.util.List;

/**
 * The persistence utility for the donvi service. This utility wraps {@link donviPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
 *
 * <p>
 * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
 * </p>
 *
 * <p>
 * Caching information and settings can be found in <code>portal.properties</code>
 * </p>
 *
 * @author Nguyen Tuan Vinh
 * @see donviPersistence
 * @see donviPersistenceImpl
 * @generated
 */
public class donviUtil {
	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
	 */
	public static void clearCache() {
		getPersistence().clearCache();
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
	 */
	public static void clearCache(donvi donvi) {
		getPersistence().clearCache(donvi);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
	 */
	public long countWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().countWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
	 */
	public static List<donvi> findWithDynamicQuery(DynamicQuery dynamicQuery)
		throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
	 */
	public static List<donvi> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end) throws SystemException {
		return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
	 */
	public static List<donvi> findWithDynamicQuery(DynamicQuery dynamicQuery,
		int start, int end, OrderByComparator orderByComparator)
		throws SystemException {
		return getPersistence()
				   .findWithDynamicQuery(dynamicQuery, start, end,
			orderByComparator);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
	 */
	public static donvi remove(donvi donvi) throws SystemException {
		return getPersistence().remove(donvi);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
	 */
	public static donvi update(donvi donvi, boolean merge)
		throws SystemException {
		return getPersistence().update(donvi, merge);
	}

	/**
	 * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
	 */
	public static donvi update(donvi donvi, boolean merge,
		ServiceContext serviceContext) throws SystemException {
		return getPersistence().update(donvi, merge, serviceContext);
	}

	/**
	* Caches the donvi in the entity cache if it is enabled.
	*
	* @param donvi the donvi to cache
	*/
	public static void cacheResult(doan.quanlycanbo.portlet.model.donvi donvi) {
		getPersistence().cacheResult(donvi);
	}

	/**
	* Caches the donvis in the entity cache if it is enabled.
	*
	* @param donvis the donvis to cache
	*/
	public static void cacheResult(
		java.util.List<doan.quanlycanbo.portlet.model.donvi> donvis) {
		getPersistence().cacheResult(donvis);
	}

	/**
	* Creates a new donvi with the primary key. Does not add the donvi to the database.
	*
	* @param madonvi the primary key for the new donvi
	* @return the new donvi
	*/
	public static doan.quanlycanbo.portlet.model.donvi create(long madonvi) {
		return getPersistence().create(madonvi);
	}

	/**
	* Removes the donvi with the primary key from the database. Also notifies the appropriate model listeners.
	*
	* @param madonvi the primary key of the donvi to remove
	* @return the donvi that was removed
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi remove(long madonvi)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().remove(madonvi);
	}

	public static doan.quanlycanbo.portlet.model.donvi updateImpl(
		doan.quanlycanbo.portlet.model.donvi donvi, boolean merge)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().updateImpl(donvi, merge);
	}

	/**
	* Finds the donvi with the primary key or throws a {@link doan.quanlycanbo.portlet.NoSuchdonviException} if it could not be found.
	*
	* @param madonvi the primary key of the donvi to find
	* @return the donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByPrimaryKey(
		long madonvi)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByPrimaryKey(madonvi);
	}

	/**
	* Finds the donvi with the primary key or returns <code>null</code> if it could not be found.
	*
	* @param madonvi the primary key of the donvi to find
	* @return the donvi, or <code>null</code> if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi fetchByPrimaryKey(
		long madonvi)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByPrimaryKey(madonvi);
	}

	/**
	* Finds all the donvis where groupId = &#63;.
	*
	* @param groupId the group id to search with
	* @return the matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByGroup(
		long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByGroup(groupId);
	}

	/**
	* Finds a range of all the donvis where groupId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @return the range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByGroup(
		long groupId, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByGroup(groupId, start, end);
	}

	/**
	* Finds an ordered range of all the donvis where groupId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByGroup(
		long groupId, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByGroup(groupId, start, end, orderByComparator);
	}

	/**
	* Finds the first donvi in the ordered set where groupId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByGroup_First(
		long groupId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByGroup_First(groupId, orderByComparator);
	}

	/**
	* Finds the last donvi in the ordered set where groupId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param groupId the group id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByGroup_Last(
		long groupId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByGroup_Last(groupId, orderByComparator);
	}

	/**
	* Finds the donvis before and after the current donvi in the ordered set where groupId = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param madonvi the primary key of the current donvi
	* @param groupId the group id to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi[] findByGroup_PrevAndNext(
		long madonvi, long groupId,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence()
				   .findByGroup_PrevAndNext(madonvi, groupId, orderByComparator);
	}

	/**
	* Finds all the donvis where donvicha = &#63;.
	*
	* @param donvicha the donvicha to search with
	* @return the matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByParent(
		long donvicha)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByParent(donvicha);
	}

	/**
	* Finds a range of all the donvis where donvicha = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param donvicha the donvicha to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @return the range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByParent(
		long donvicha, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByParent(donvicha, start, end);
	}

	/**
	* Finds an ordered range of all the donvis where donvicha = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param donvicha the donvicha to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByParent(
		long donvicha, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByParent(donvicha, start, end, orderByComparator);
	}

	/**
	* Finds the first donvi in the ordered set where donvicha = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param donvicha the donvicha to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByParent_First(
		long donvicha,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByParent_First(donvicha, orderByComparator);
	}

	/**
	* Finds the last donvi in the ordered set where donvicha = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param donvicha the donvicha to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByParent_Last(
		long donvicha,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByParent_Last(donvicha, orderByComparator);
	}

	/**
	* Finds the donvis before and after the current donvi in the ordered set where donvicha = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param madonvi the primary key of the current donvi
	* @param donvicha the donvicha to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi[] findByParent_PrevAndNext(
		long madonvi, long donvicha,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence()
				   .findByParent_PrevAndNext(madonvi, donvicha,
			orderByComparator);
	}

	/**
	* Finds all the donvis where makhoi = &#63;.
	*
	* @param makhoi the makhoi to search with
	* @return the matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByKhoiDV(
		long makhoi) throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByKhoiDV(makhoi);
	}

	/**
	* Finds a range of all the donvis where makhoi = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param makhoi the makhoi to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @return the range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByKhoiDV(
		long makhoi, int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findByKhoiDV(makhoi, start, end);
	}

	/**
	* Finds an ordered range of all the donvis where makhoi = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param makhoi the makhoi to search with
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findByKhoiDV(
		long makhoi, int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence()
				   .findByKhoiDV(makhoi, start, end, orderByComparator);
	}

	/**
	* Finds the first donvi in the ordered set where makhoi = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param makhoi the makhoi to search with
	* @param orderByComparator the comparator to order the set by
	* @return the first matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByKhoiDV_First(
		long makhoi,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByKhoiDV_First(makhoi, orderByComparator);
	}

	/**
	* Finds the last donvi in the ordered set where makhoi = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param makhoi the makhoi to search with
	* @param orderByComparator the comparator to order the set by
	* @return the last matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByKhoiDV_Last(
		long makhoi,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByKhoiDV_Last(makhoi, orderByComparator);
	}

	/**
	* Finds the donvis before and after the current donvi in the ordered set where makhoi = &#63;.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param madonvi the primary key of the current donvi
	* @param makhoi the makhoi to search with
	* @param orderByComparator the comparator to order the set by
	* @return the previous, current, and next donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a donvi with the primary key could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi[] findByKhoiDV_PrevAndNext(
		long madonvi, long makhoi,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence()
				   .findByKhoiDV_PrevAndNext(madonvi, makhoi, orderByComparator);
	}

	/**
	* Finds the donvi where madonvi = &#63; and groupId = &#63; or throws a {@link doan.quanlycanbo.portlet.NoSuchdonviException} if it could not be found.
	*
	* @param madonvi the madonvi to search with
	* @param groupId the group id to search with
	* @return the matching donvi
	* @throws doan.quanlycanbo.portlet.NoSuchdonviException if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi findByD_G(long madonvi,
		long groupId)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		return getPersistence().findByD_G(madonvi, groupId);
	}

	/**
	* Finds the donvi where madonvi = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
	*
	* @param madonvi the madonvi to search with
	* @param groupId the group id to search with
	* @return the matching donvi, or <code>null</code> if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi fetchByD_G(
		long madonvi, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByD_G(madonvi, groupId);
	}

	/**
	* Finds the donvi where madonvi = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
	*
	* @param madonvi the madonvi to search with
	* @param groupId the group id to search with
	* @return the matching donvi, or <code>null</code> if a matching donvi could not be found
	* @throws SystemException if a system exception occurred
	*/
	public static doan.quanlycanbo.portlet.model.donvi fetchByD_G(
		long madonvi, long groupId, boolean retrieveFromCache)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().fetchByD_G(madonvi, groupId, retrieveFromCache);
	}

	/**
	* Finds all the donvis.
	*
	* @return the donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll();
	}

	/**
	* Finds a range of all the donvis.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @return the range of donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findAll(
		int start, int end)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end);
	}

	/**
	* Finds an ordered range of all the donvis.
	*
	* <p>
	* Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
	* </p>
	*
	* @param start the lower bound of the range of donvis to return
	* @param end the upper bound of the range of donvis to return (not inclusive)
	* @param orderByComparator the comparator to order the results by
	* @return the ordered range of donvis
	* @throws SystemException if a system exception occurred
	*/
	public static java.util.List<doan.quanlycanbo.portlet.model.donvi> findAll(
		int start, int end,
		com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().findAll(start, end, orderByComparator);
	}

	/**
	* Removes all the donvis where groupId = &#63; from the database.
	*
	* @param groupId the group id to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByGroup(long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByGroup(groupId);
	}

	/**
	* Removes all the donvis where donvicha = &#63; from the database.
	*
	* @param donvicha the donvicha to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByParent(long donvicha)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByParent(donvicha);
	}

	/**
	* Removes all the donvis where makhoi = &#63; from the database.
	*
	* @param makhoi the makhoi to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByKhoiDV(long makhoi)
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeByKhoiDV(makhoi);
	}

	/**
	* Removes the donvi where madonvi = &#63; and groupId = &#63; from the database.
	*
	* @param madonvi the madonvi to search with
	* @param groupId the group id to search with
	* @throws SystemException if a system exception occurred
	*/
	public static void removeByD_G(long madonvi, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException,
			doan.quanlycanbo.portlet.NoSuchdonviException {
		getPersistence().removeByD_G(madonvi, groupId);
	}

	/**
	* Removes all the donvis from the database.
	*
	* @throws SystemException if a system exception occurred
	*/
	public static void removeAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		getPersistence().removeAll();
	}

	/**
	* Counts all the donvis where groupId = &#63;.
	*
	* @param groupId the group id to search with
	* @return the number of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static int countByGroup(long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByGroup(groupId);
	}

	/**
	* Counts all the donvis where donvicha = &#63;.
	*
	* @param donvicha the donvicha to search with
	* @return the number of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static int countByParent(long donvicha)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByParent(donvicha);
	}

	/**
	* Counts all the donvis where makhoi = &#63;.
	*
	* @param makhoi the makhoi to search with
	* @return the number of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static int countByKhoiDV(long makhoi)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByKhoiDV(makhoi);
	}

	/**
	* Counts all the donvis where madonvi = &#63; and groupId = &#63;.
	*
	* @param madonvi the madonvi to search with
	* @param groupId the group id to search with
	* @return the number of matching donvis
	* @throws SystemException if a system exception occurred
	*/
	public static int countByD_G(long madonvi, long groupId)
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countByD_G(madonvi, groupId);
	}

	/**
	* Counts all the donvis.
	*
	* @return the number of donvis
	* @throws SystemException if a system exception occurred
	*/
	public static int countAll()
		throws com.liferay.portal.kernel.exception.SystemException {
		return getPersistence().countAll();
	}

	public static donviPersistence getPersistence() {
		if (_persistence == null) {
			_persistence = (donviPersistence)PortletBeanLocatorUtil.locate(doan.quanlycanbo.portlet.service.ClpSerializer.SERVLET_CONTEXT_NAME,
					donviPersistence.class.getName());
		}

		return _persistence;
	}

	public void setPersistence(donviPersistence persistence) {
		_persistence = persistence;
	}

	private static donviPersistence _persistence;
}